Computer virtualization is a technique involved in creation of a virtual machine that acts like a physical computing machine with an operating system, and a computer virtualization architecture is generally defined by the ability to concurrently support multiple operating systems on a single physical computer platform. For example, a computer that is running Microsoft Windows may host a virtual machine with a Linux operating system. A host machine is an actual physical machine on which the virtualization takes place, while a virtual machine is considered as a guest machine. A hypervisor, literally referred to as a virtual machine monitor (VMM), is a software layer that virtualizes hardware resources and presents a virtual hardware interface to at least one virtual machine. The hypervisor resembles to the way that a traditional operating system manages the hardware resources for processing and performs certain management functions with respect to an executing virtual machine. The virtual machine may be referred to as a “guest” and the operating system running inside the virtual machine may be referred to as a “guest OS”.
The virtualized environment is currently memory-bound, which means that the physical memory of the host machine is the bottleneck of the resource utilization in a data center. Memory virtualization decouples the physical memory resources from the data center and then aggregates the resources into a virtualized memory pool which is accessible to the guest OS or applications running on top of the guest OS. In terms of memory virtualization, memory sharing is one of the crucial topics to the memory resource management and utilization.
When there are multiple virtual machines running on a host machine with low memory, memory distribution to the virtual machines becomes important to the application performance. The physical memory should be allocated among the virtual machines in a fair way, and such operation is defined as “memory balancing.”
The simplest form of memory balancing is to divide the available physical memory by the number of virtual machines, and give each of the virtual machines an equal amount of memory. However, such mechanism does not take into account the working set size of each of the virtual machines, wherein the working set size is an amount of memory required to run applications on each of the virtual machines. That is, the implicit assumption of this approach is that each of the virtual machines is identical, including the applications running on top of the virtual machines and the input workloads.
Another approach is to assign to each of the virtual machines a percentage of the available physical memory that is proportional to each working set size. The intuition is to give larger amount of the memory to the virtual machine with larger demand on memory resource. With such allocation, the difference between the working set size of a virtual machine and its allocated memory is also proportional to the working set size of the virtual machine. This means that any additional event penalty (such as refault or swapin events) when the memory allocation of a virtual machine is decreased from its working set size to a fixed percentage of its working set size may be higher for virtual machines with a larger working set size.
To prevent the virtual machines from severe performance degradation due to insufficient memory, the performance overhead of each of the virtual machine running on the same host machine may require to be equalized by employing more suitable memory balancing mechanisms.